life is too short for a diary



Posts Tagged: spring boot

Testing Preauthorize Annotation in Spring Boot

Preauthorize annotation can be use to enforce access control in Spring Boot applications. It's part of Spring Security that allows you to specify access control expression for methods. These expressions are evaluated before method execution, determining whether the current user has the authority to invoke the method...

Continue reading → java spring boot spring security



Handling Multiple Beans of the Same Type in Spring with Qualifier

In Spring application, it's common to have multiple beans of the same type. However, this can lead to issues when Spring tries to autowire these beans, as it doesn't know which bean to inject. This problem can be resolved using Qualifier annotation...

Continue reading → spring boot spring



Getting Started with Spring AI

In this blog, we'll explore how to create a simple Spring Boot application that leverages Spring AI for generating responses. We'll build a BooksApi application that can tell us which book won the booker prize for a given year...

Continue reading → spring boot



Delving into CommandLineRunner in Spring Boot

Spring Boot provides a range of functionalities that allow developers to run specific code blocks during the application's lifecycle. One such feature is the CommandLineRunner interface. This interface is specifically designed to execute a code block just once, right after the Spring Boot application has initialized. This can be particularly useful for tasks like database seeding, running sanity checks, or any other initialization logic you want to run before your application begins processing...

Continue reading → spring boot



Mastering Reactive Pagination with Spring Boot and MongoDB

As we delve into the realms of sophisticated data management, we will be harnessing the strengths of Spring Boot, the agility of MongoDB, and the responsiveness of reactive programming to implement an efficient pagination system. Pagination is a critical feature, instrumental in enhancing user experience and application performance. By the end of this guide, you'll have a deep understanding of reactive pagination, equipping you with the skills to manage large data sets with ease and proficiency. Let's get started...

Continue reading → spring boot java mongodb



TestContainers with Spring Boot

Testcontainers is a Java library that provides lightweight, disposable containers for running integration tests. It's a useful tool for testing applications that rely on external dependencies like databases or message queues...

Continue reading → java spring boot testcontainers